package com.chh.jproto;

import com.baidu.bjf.remoting.protobuf.Any;
import com.baidu.bjf.remoting.protobuf.FieldType;
import com.baidu.bjf.remoting.protobuf.annotation.Protobuf;
import com.baidu.bjf.remoting.protobuf.annotation.ProtobufClass;
import lombok.*;
import lombok.experimental.FieldDefaults;

import java.util.List;

/**
 * @author 一碗情深
 * @since 2024-08-09 星期五 14:03:44
 */
@Getter
@Setter
@ToString
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ProtobufClass
@FieldDefaults(level = AccessLevel.PUBLIC)
public class HouseJProto {

    @Protobuf(fieldType = FieldType.UINT32, order = 1)
    private Integer id;
    @Protobuf(fieldType = FieldType.ENUM, order = 2)
    private HouseType type;
    @Protobuf(fieldType = FieldType.UINT32, order = 3)
    private Integer boughtTime;
    @Protobuf(fieldType = FieldType.UINT64, order = 4)
    private Long price;
    @Protobuf(fieldType = FieldType.OBJECT, order = 5)
    private List<PeopleJProto> owner;
    @Protobuf(fieldType = FieldType.OBJECT, order = 6)
    private Any ownerExtent;

    @ProtobufClass
    public enum HouseType {
        OTHERS(0),
        ROOM_ONE(1),
        ROOM_TWO(2),
        ROOM_THREE(3),
        LOFT(4);

        @Protobuf(fieldType = FieldType.INT32, order = 1)
        private final Integer value;

        HouseType(Integer value) {
            this.value = value;
        }

        public Integer getValue() {
            return value;
        }
    }
}
